package translation;

import java.util.LinkedList;

public class Net {

	
	private String name;
	private LinkedList <Part> parts;
//	private LinkedList <String> pads;
	private LinkedList <String> connectors;
	private NetSystem netSys;
	
	
	/**
	 * @param name
	 * @param parts
	 * @param pads Pads are not in use right now, but could be added back in if needed
	 */
	public Net(String name, LinkedList<String> parts, LinkedList<String> pads,
			LinkedList<String> pins, NetSystem netSys) {
		super();
		this.name = name;
		this.parts = new LinkedList<Part>();
		for (String s: parts) {
			this.parts.add(netSys.getCircuit().getPartSys().findPart(s));
		}
//		this.pads = pads;
		this.connectors = new LinkedList<String>();
		for (int i = 0; i < pins.size(); i++) {
			this.connectors.add(this.parts.get(i).getConnectors().get(pins.get(i)));
		}
		this.netSys = netSys;
	}


	/**
	 * @return
	 */
	public String getName() {
		return name;
	}


	/**
	 * @return
	 */
	public LinkedList<Part> getParts() {
		return parts;
	}
	
	/**
	 * @param i
	 * @return
	 */
	public Part getParts(int i) {
		return parts.get(i);
	}


	/**
	 * @return
	 */
	public LinkedList<String> getConnectors() {
		return connectors;
	}

	/**
	 * @param i
	 * @return
	 */
	public String getConnectors(int i) {
		return connectors.get(i);
	}

	

	/**
	 * @return
	 */
	public NetSystem getNetSys() {
		return netSys;
	}

	
	
}
